package com.qf.service.impl;

import com.qf.dao.ProfileDao;
import com.qf.dao.impl.ProfileDaoImpl;
import com.qf.entity.PageBean;
import com.qf.entity.Profile;
import com.qf.service.ProfileService;

import java.util.List;

public class ProfileServiceImpl implements ProfileService {
    private ProfileDao profileDao=new ProfileDaoImpl();

    @Override
    public List<Profile> findAll() {
        return profileDao.selectAll();
    }

    @Override
    public PageBean<Profile> findByPage(int pn, int ps) {
        long totalSize=profileDao.selectCount();
        List<Profile> data=profileDao.selectByPage(pn,ps);
        PageBean<Profile> pageBean=new PageBean<Profile>(pn, ps, totalSize, data);
        return pageBean;
    }
}
